#!/bin/bash

path=$PATH
echo $path
#shortest delete from left
echo ${path#/*/local/sbin:}
#longest delete from left
echo ${path##/*/bin:}
#shortest delete from right
echo ${path%/*/local/sbin:}
#longest delete from right
echo ${path%%/*/local/sbin:}
#replace first
echo ${path/bin/BIN/}
#replace all
echo ${path//bin/BIN/}
